package edu.mama.college.controller;

import edu.mama.college.model.Carousel;
import edu.mama.college.model.JsonResult;
import edu.mama.college.service.CarouselService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CarouselController {

    @Autowired
    private CarouselService service;

    @GetMapping("/resource/carousel")
    public JsonResult carousel(){
        List<Carousel> carousels = service.getCarousels();
        return JsonResult.success(carousels);
    }
}
